package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.Company;
import com.zygh.policeasset.pojo.Hardwit;
import com.zygh.policeasset.pojo.export.ExportHardwit;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;
import org.springframework.web.bind.annotation.RequestParam;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/HardwitMapper.class */
public interface HardwitMapper {
    @Delete({"delete from assets_hardwit where id = #{id,jdbcType=INTEGER}"})
    int deleteById(Integer num);

    @Insert({"insert into assets_hardwit (asset_num, build_num, pact_name, ", "big_num, small_num, ", "facility_name, facility_ip, ", "start_time, stop_time, ", "start_money,depreciation_period,plan_year, ", "quality_year, place, ", "brand_name, ", "brand_type, take_police, ", "construc_unit, build_unit, ", "maintain_unit, power_type, ", "whether_enable, whether_power, whether_network, ", "remark, create_time, ", "user_id, approval_status,assets_status,section_name,section_id,company_id,data_labels_id)", "values (#{assetNum,jdbcType=VARCHAR}, #{buildNum,jdbcType=VARCHAR}, #{pactName,jdbcType=VARCHAR}, ", "#{bigNum,jdbcType=VARCHAR}, #{smallNum,jdbcType=VARCHAR}, ", "#{facilityName,jdbcType=VARCHAR}, #{facilityIp,jdbcType=VARCHAR}, ", "#{startTime,jdbcType=VARCHAR}, #{stopTime,jdbcType=VARCHAR}, ", "#{startMoney,jdbcType=VARCHAR},#{depreciationPeriod,jdbcType=INTEGER},#{planYear,jdbcType=VARCHAR},", "#{qualityYear,jdbcType=VARCHAR}, #{place,jdbcType=VARCHAR},", " #{brandName,jdbcType=VARCHAR}, ", "#{brandType,jdbcType=VARCHAR}, #{takePolice,jdbcType=VARCHAR}, ", "#{construcUnit,jdbcType=VARCHAR}, #{buildUnit,jdbcType=VARCHAR}, ", "#{maintainUnit,jdbcType=VARCHAR}, #{powerType,jdbcType=VARCHAR}, ", "#{whetherEnable,jdbcType=VARCHAR}, #{whetherPower,jdbcType=VARCHAR}, #{whetherNetwork,jdbcType=VARCHAR}, ", "#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, ", "#{userId,jdbcType=INTEGER}, #{approvalStatus,jdbcType=VARCHAR}, #{assetsStatus,jdbcType=VARCHAR},#{sectionName,jdbcType=VARCHAR},#{sectionId,jdbcType=VARCHAR},#{companyId,jdbcType=INTEGER},#{dataLabelsId,jdbcType=INTEGER})"})
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int add(Hardwit hardwit);

    @Select({"select * from assets_hardwit", "where id = #{id,jdbcType=INTEGER}"})
    @Results(id = "hardwitMap", value = {@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "asset_num", property = "assetNum", jdbcType = JdbcType.VARCHAR), @Result(column = "build_num", property = "buildNum", jdbcType = JdbcType.VARCHAR), @Result(column = "pact_name", property = "pactName", jdbcType = JdbcType.VARCHAR), @Result(column = "big_num", property = "bigNum", jdbcType = JdbcType.VARCHAR), @Result(column = "small_num", property = "smallNum", jdbcType = JdbcType.VARCHAR), @Result(column = "facility_name", property = "facilityName", jdbcType = JdbcType.VARCHAR), @Result(column = "facility_ip", property = "facilityIp", jdbcType = JdbcType.VARCHAR), @Result(column = "start_time", property = "startTime", jdbcType = JdbcType.VARCHAR), @Result(column = "stop_time", property = "stopTime", jdbcType = JdbcType.VARCHAR), @Result(column = "start_money", property = "startMoney", jdbcType = JdbcType.VARCHAR), @Result(column = "depreciation_period", property = "depreciationPeriod", jdbcType = JdbcType.INTEGER), @Result(column = "plan_year", property = "planYear", jdbcType = JdbcType.VARCHAR), @Result(column = "quality_year", property = "qualityYear", jdbcType = JdbcType.VARCHAR), @Result(column = "place", property = "place", jdbcType = JdbcType.VARCHAR), @Result(column = "brand_name", property = "brandName", jdbcType = JdbcType.VARCHAR), @Result(column = "brand_type", property = "brandType", jdbcType = JdbcType.VARCHAR), @Result(column = "take_police", property = "takePolice", jdbcType = JdbcType.VARCHAR), @Result(column = "construc_unit", property = "construcUnit", jdbcType = JdbcType.VARCHAR), @Result(column = "build_unit", property = "buildUnit", jdbcType = JdbcType.VARCHAR), @Result(column = "maintain_unit", property = "maintainUnit", jdbcType = JdbcType.VARCHAR), @Result(column = "power_type", property = "powerType", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_enable", property = "whetherEnable", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_power", property = "whetherPower", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_network", property = "whetherNetwork", jdbcType = JdbcType.VARCHAR), @Result(column = "remark", property = "remark", jdbcType = JdbcType.VARCHAR), @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.VARCHAR), @Result(column = "user_id", property = "userId", jdbcType = JdbcType.INTEGER), @Result(column = "approval_status", property = "approvalStatus", jdbcType = JdbcType.VARCHAR), @Result(column = "assets_status", property = "assetsStatus", jdbcType = JdbcType.VARCHAR), @Result(column = "witbig_name", property = "witbigName", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_name", property = "witsmallName", jdbcType = JdbcType.VARCHAR), @Result(column = "construc_name", property = "construcName", jdbcType = JdbcType.VARCHAR), @Result(column = "build_name", property = "buildName", jdbcType = JdbcType.VARCHAR), @Result(column = "maintainName", property = "maintainName", jdbcType = JdbcType.VARCHAR), @Result(column = "steps_id", property = "stepsId", jdbcType = JdbcType.VARCHAR), @Result(column = "pass_next_id", property = "passNextId", jdbcType = JdbcType.VARCHAR), @Result(column = "rejected_next_id", property = "rejectedNextId", jdbcType = JdbcType.VARCHAR), @Result(column = "explanation", property = "explanation", jdbcType = JdbcType.VARCHAR), @Result(column = "overhaul_remark", property = "overhaulRemark", jdbcType = JdbcType.VARCHAR), @Result(column = "overhaul_start_money", property = "overhaulStartMoney", jdbcType = JdbcType.VARCHAR), @Result(column = "overhaul_depreciationperiod", property = "overhaulDepreciationPeriod", jdbcType = JdbcType.VARCHAR), @Result(column = "overhaul_depreciationrate", property = "overhaulDepreciationRate", jdbcType = JdbcType.VARCHAR), @Result(column = "stop_run_time", property = "stopRunTime", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_enable", property = "whetherEnable", jdbcType = JdbcType.VARCHAR), @Result(column = "overhaul_time", property = "overhaulTime", jdbcType = JdbcType.VARCHAR), @Result(column = "maintainName", property = "maintainName", jdbcType = JdbcType.VARCHAR), @Result(column = "payment_time", property = "paymentTime", jdbcType = JdbcType.VARCHAR), @Result(column = "start_provision_date", property = "startProvisionDate", jdbcType = JdbcType.VARCHAR), @Result(column = "assets_classification_id", property = "assetsClassificationId", jdbcType = JdbcType.INTEGER), @Result(column = "assets_classification_pid", property = "assetsClassificationPid", jdbcType = JdbcType.INTEGER), @Result(column = "section_name", property = "sectionName", jdbcType = JdbcType.VARCHAR), @Result(column = "section_id", property = "sectionId", jdbcType = JdbcType.INTEGER), @Result(column = "company_id", property = "companyId", jdbcType = JdbcType.INTEGER), @Result(column = "data_labels_id", property = "dataLabelsId", jdbcType = JdbcType.INTEGER)})
    Hardwit findById(Integer num);

    @Select({"select * from assets_hardwit"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findAll();

    @Update({"update assets_hardwit set asset_num = #{assetNum,jdbcType=VARCHAR},", "build_num = #{buildNum,jdbcType=VARCHAR},", "pact_name = #{pactName,jdbcType=VARCHAR},", "big_num = #{bigNum,jdbcType=VARCHAR},", "small_num = #{smallNum,jdbcType=VARCHAR},", "facility_name = #{facilityName,jdbcType=VARCHAR},", "facility_ip = #{facilityIp,jdbcType=VARCHAR},", "start_time = #{startTime,jdbcType=VARCHAR},", "stop_time = #{stopTime,jdbcType=VARCHAR},", "start_money = #{startMoney,jdbcType=VARCHAR},", "depreciation_period = #{depreciationPeriod,jdbcType=INTEGER},", "plan_year = #{planYear,jdbcType=VARCHAR},", "quality_year = #{qualityYear,jdbcType=VARCHAR},", "place = #{place,jdbcType=VARCHAR},", "brand_name = #{brandName,jdbcType=VARCHAR},", "brand_type = #{brandType,jdbcType=VARCHAR},", "take_police = #{takePolice,jdbcType=VARCHAR},", "construc_unit = #{construcUnit,jdbcType=VARCHAR},", "build_unit = #{buildUnit,jdbcType=VARCHAR},", "maintain_unit = #{maintainUnit,jdbcType=VARCHAR},", "power_type = #{powerType,jdbcType=VARCHAR},", "whether_enable = #{whetherEnable,jdbcType=VARCHAR},", "whether_power = #{whetherPower,jdbcType=VARCHAR},", "whether_network = #{whetherNetwork,jdbcType=VARCHAR},", "remark = #{remark,jdbcType=VARCHAR},", "create_time = #{createTime,jdbcType=VARCHAR},", "user_id = #{userId,jdbcType=INTEGER},", "approval_status = #{approvalStatus,jdbcType=VARCHAR},", "assets_status = #{assetsStatus,jdbcType=VARCHAR}", "where id = #{id,jdbcType=INTEGER}"})
    int updateById(Hardwit hardwit);

    @Select({"SELECT t1.*,t2.witbig_name,t3.unit_name AS build_name,t4.unit_name AS construc_name,t10.unit_name AS maintainName,t6.witsmall_name,t7.steps_id,t7.pass_next_id,t7.rejected_next_id,t7.explanation FROM\n assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'zn') t2 ON t1.big_num=t2.`witbig_num`  \n LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t3 ON t1.build_unit = t3.unit_num \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.construc_unit= t4.unit_num  \nLEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t10 ON t1.maintain_unit= t10.unit_num     LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'zn') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num \n    LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type\n    WHERE t1.build_num= #{buildNum} "})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findByCondition(@RequestParam String str);

    @Select({"SELECT t1.*,t2.witbig_name,t3.unit_name AS build_name,t4.unit_name AS construc_name,t10.unit_name AS maintainName,t6.witsmall_name,t7.steps_id,t7.pass_next_id,t7.rejected_next_id,t7.explanation FROM\n assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'zn') t2 ON t1.big_num=t2.`witbig_num`  \n LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t3 ON t1.build_unit = t3.unit_num \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.construc_unit= t4.unit_num  \nLEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t10 ON t1.maintain_unit= t10.unit_num     LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'zn') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num \n    LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type\n    WHERE t1.build_num= #{buildNum} "})
    @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "asset_num", property = "assetNum", jdbcType = JdbcType.VARCHAR), @Result(column = "pact_name", property = "pactName", jdbcType = JdbcType.VARCHAR), @Result(column = "facility_name", property = "facilityName", jdbcType = JdbcType.VARCHAR), @Result(column = "facility_ip", property = "facilityIp", jdbcType = JdbcType.VARCHAR), @Result(column = "start_time", property = "startTime", jdbcType = JdbcType.VARCHAR), @Result(column = "stop_time", property = "stopTime", jdbcType = JdbcType.VARCHAR), @Result(column = "start_money", property = "startMoney", jdbcType = JdbcType.VARCHAR), @Result(column = "plan_year", property = "planYear", jdbcType = JdbcType.VARCHAR), @Result(column = "quality_year", property = "qualityYear", jdbcType = JdbcType.VARCHAR), @Result(column = "place", property = "place", jdbcType = JdbcType.VARCHAR), @Result(column = "brand_name", property = "brandName", jdbcType = JdbcType.VARCHAR), @Result(column = "brand_type", property = "brandType", jdbcType = JdbcType.VARCHAR), @Result(column = "take_police", property = "takePolice", jdbcType = JdbcType.VARCHAR), @Result(column = "power_type", property = "powerType", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_enable", property = "whetherEnable", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_power", property = "whetherPower", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_network", property = "whetherNetwork", jdbcType = JdbcType.VARCHAR), @Result(column = "remark", property = "remark", jdbcType = JdbcType.VARCHAR), @Result(column = "witbig_name", property = "witbigName", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_name", property = "witsmallName", jdbcType = JdbcType.VARCHAR), @Result(column = "construc_name", property = "construcName", jdbcType = JdbcType.VARCHAR), @Result(column = "build_name", property = "buildName", jdbcType = JdbcType.VARCHAR), @Result(column = "maintainName", property = "maintainName", jdbcType = JdbcType.VARCHAR), @Result(column = "whether_enable", property = "whetherEnable", jdbcType = JdbcType.VARCHAR)})
    List<ExportHardwit> exportExcel(@RequestParam String str);

    @Update({"update assets_hardwit set assets_status=#{assetsStatus}where id = #{id}"})
    int updatestatus(@Param("assetsStatus") String str, @Param("id") Integer num);

    @Update({"update assets_hardwit set asset_num=#{assetNum}where id = #{id}"})
    int updateStatusBynum(@Param("assetNum") String str, @Param("id") Integer num);

    @Select({"<script>SELECT t1.*,t2.witbig_name,t3.unit_name AS build_name,t4.unit_name AS construc_name,t10.unit_name AS maintainName,t6.witsmall_name,t7.steps_id,t7.pass_next_id,t7.rejected_next_id,t7.explanation,t9.audit_time, ac1.`name` AS assetsClassificationPName,ac.`name` AS assetsClassificationName from assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'zn') t2 ON t1.big_num=t2.`witbig_num`   LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t3 ON t1.build_unit = t3.unit_num   LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.construc_unit= t4.unit_num    LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t10 ON t1.maintain_unit= t10.unit_num    LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'zn') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num  LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type LEFT JOIN settlement t9 ON t1.section_id=t9.section_id LEFT JOIN assets_classification ac1 ON t1.assets_classification_pid=ac1.id LEFT JOIN assets_classification ac ON t1.assets_classification_id=ac.id <trim prefix='where' prefixOverrides='and | or'><if test='roleId != null and roleId.length() &gt; 0'>t7.role_id= #{roleId} </if><if test='buildNum != null and buildNum.length() &gt; 0'>and t1.build_num= #{buildNum}</if><if test='facilityName != null and facilityName.length() &gt; 0'>and t1.facility_name like concat('%',#{facilityName},'%') </if><if test='assetsStatus != null and assetsStatus.length() &gt; 0'>and t1.assets_status= #{assetsStatus} </if><if test='sectionName != null and sectionName.length() &gt; 0'>and t1.section_name= #{sectionName} </if><if test='companyId != null and companyId.length() &gt; 0'>and t1.company_id= #{companyId} </if><if test='assetsClassificationId == 0'>AND t1.assets_classification_id IS  NULL </if><if test='assetsClassificationId == 1'>AND t1.assets_classification_id IS NOT NULL </if></trim> </script>"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findByRoleId(Hardwit hardwit);

    @Select({"SELECT count(*) FROM assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'zn') t2 ON t1.big_num=t2.`witbig_num`  \n LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t3 ON t1.construc_unit = t3.unit_num \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.build_unit= t4.unit_num  \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t10 ON t1.maintain_unit= t10.unit_num  \n   LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'zn') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num \n LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type\n where t7.role_id= #{roleId} AND t1.assets_status =#{status}"})
    Integer findCount(Integer num, String str);

    @Select({"<script>SELECT count(*) FROM\n assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'zn') t2 ON t1.big_num=t2.`witbig_num`  \n LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t3 ON t1.construc_unit = t3.unit_num \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.build_unit= t4.unit_num  \n   LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'zn') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num \n LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type\n<trim prefix='where' prefixOverrides='and | or'><if test='roleId != null and roleId.length() &gt; 0'>t7.role_id= #{roleId} </if><if test='buildNum != null and buildNum.length() &gt; 0'>and t1.build_num= #{buildNum}</if><if test='assetsStatus != null and assetsStatus.length() &gt; 0'>and t1.assets_status= #{assetsStatus} </if></trim> </script>"})
    int findByRoleIdToCount(Hardwit hardwit);

    @Select({"<script>SELECT t1.*,t2.witbig_name,t3.unit_name AS build_name,t4.unit_name AS construc_name,t10.unit_name AS maintainName,t6.witsmall_name,t7.steps_id,t7.pass_next_id,t7.rejected_next_id,t7.explanation,t9.`transfer_remark`,t9.`address`,t9.transfer_depreciationperiod FROM assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'zn') t2 ON t1.big_num=t2.`witbig_num`  \n LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t3 ON t1.construc_unit = t3.unit_num \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.build_unit= t4.unit_num  \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t10 ON t1.maintain_unit= t10.unit_num  \n   LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'zn') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num \n LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type LEFT JOIN `asset_transfer` t9 ON t1.id = t9.`asset_id` AND t1.assets_status = t9.`asset_type`\n<trim prefix='where' prefixOverrides='and | or'><if test='roleId != null and roleId.length() &gt; 0'>t7.role_id= #{roleId} </if><if test='buildNum != null and buildNum.length() &gt; 0'>and t1.build_num= #{buildNum}</if><if test='assetsStatus != null and assetsStatus.length() &gt; 0'>and t1.assets_status= #{assetsStatus} </if></trim> </script>"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findBytransfer(Hardwit hardwit);

    @Select({"<script>SELECT t1.*,t2.witbig_name,t3.unit_name AS build_name,t4.unit_name AS construc_name,t10.unit_name AS maintainName,t6.witsmall_name,t7.steps_id,t7.pass_next_id,t7.rejected_next_id,t7.explanation,t9.`overhaul_remark`,t9.`overhaul_start_money`,t9.overhaul_depreciationperiod,t9.overhaul_time FROM\n assets_hardwit t1 LEFT JOIN (SELECT *  FROM witbig WHERE TYPE= 'jc') t2 ON t1.big_num=t2.`witbig_num`  \n LEFT JOIN (SELECT * FROM unit WHERE TYPE='jc') t3 ON t1.construc_unit = t3.unit_num \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zd') t4 ON t1.build_unit= t4.unit_num  \n  LEFT JOIN (SELECT * FROM unit WHERE TYPE='zn') t10 ON t1.maintain_unit= t10.unit_num  \n   LEFT JOIN  (SELECT *  FROM witsmall WHERE TYPE= 'jc') t6 ON t1.small_num = t6.witsmall_num AND t1.big_num = t6.witbig_num \n LEFT JOIN  assets_id_type t8 ON t1.id = t8.asset_id AND t1.assets_status = t8.asset_type LEFT JOIN assets_approval_steps t7 ON t7.steps_id = t8.steps_id AND t1.assets_status = t7.steps_type LEFT JOIN `asset_overhaul` t9 ON t1.id = t9.`asset_id` AND t1.assets_status = t9.`asset_type`\n<trim prefix='where' prefixOverrides='and | or'><if test='roleId != null and roleId.length() &gt; 0'>t7.role_id= #{roleId} </if><if test='buildNum != null and buildNum.length() &gt; 0'>and t1.build_num= #{buildNum}</if><if test='assetsStatus != null and assetsStatus.length() &gt; 0'>and t1.assets_status= #{assetsStatus} </if>and  t9.overhaul_status = 1</trim> </script>"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findByoverhaul(Hardwit hardwit);

    @Select({"select * from assets_hardwit where build_num = #{buildNum}"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findAllByBuildNum(String str);

    @Update({"update assets_hardwit set assets_status=#{assetsStatus}where build_num = #{buildNum}"})
    int updatestatusByBuildNum(@Param("assetsStatus") String str, @Param("buildNum") String str2);

    @Update({"update assets_hardwit set place=#{place} where id = #{id}"})
    int updatePlaceById(@Param("place") String str, @Param("id") Integer num);

    @Update({"update assets_hardwit set start_money=#{startMoney},depreciation_period=#{depreciationPeriod},whether_enable=#{whetherEnable},create_time=#{createTime} where id = #{id}"})
    int updatePlaceByStartMoney(@Param("startMoney") String str, @Param("depreciationPeriod") Integer num, @Param("id") Integer num2, @Param("whetherEnable") String str2, @Param("createTime") String str3);

    @Update({"update assets_hardwit set stop_run_time=#{stopRunTime},whether_enable=#{whetherEnable} where id = #{id}"})
    int updateStopRunTime(@Param("stopRunTime") String str, @Param("whetherEnable") String str2, @Param("id") Integer num);

    @Update({"update assets_hardwit set payment_time = #{paymentTime,jdbcType=VARCHAR} where build_num = #{buildNum,jdbcType=VARCHAR}"})
    int affirmPay(@Param("buildNum") String str, @Param("paymentTime") String str2);

    @Select({"select * from assets_hardwit"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> all();

    @Select({"SELECT a.*,s.audit_time FROM assets_hardwit a LEFT JOIN  `settlement` s ON a.section_id=s.section_id  WHERE a.section_id=#{sectionId}"})
    @ResultMap({"hardwitMap"})
    List<Hardwit> findBySectionId(@Param("sectionId") Integer num);

    @Select({"SELECT IFNULL(bb.count1,0) as remark FROM calendar ca  LEFT JOIN  (SELECT DATE_FORMAT(t.`do_time`, '%Y-%m-%d') triggerDay,assets_status, COUNT(id) AS count1 FROM assets_hardwit  a LEFT JOIN  assets_id_type t ON a.id = t.asset_id AND a.assets_status  = #{type}    WHERE  DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(t.`do_time`) AND steps_id =-1 GROUP BY triggerDay,assets_status ORDER BY t.`do_time`)  bb ON ca.`datelist`=bb.triggerDay WHERE    DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DATE(ca.datelist)&&DATE(ca.datelist)<=CURDATE()-1"})
    List<String> discountChart(String str);

    @Select({"SELECT IFNULL(bb.count1,0) as remark FROM calendar ca  LEFT JOIN  (SELECT DATE_FORMAT(t.`do_time`, '%Y-%m-%d') triggerDay,assets_status, COUNT(id) AS count1 FROM assets_hardwit  a LEFT JOIN  assets_id_type t ON a.id = t.asset_id AND t.asset_type  = #{type}    WHERE  DATE_SUB(CURDATE(), INTERVAL 7 DAY) < DATE(t.`do_time`) AND steps_id =-1 GROUP BY triggerDay,assets_status ORDER BY t.`do_time`)  bb ON ca.`datelist`=bb.triggerDay WHERE    DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DATE(ca.datelist)&&DATE(ca.datelist)<=CURDATE()-1"})
    List<String> discountChart1(String str);

    @Select({"SELECT a.company_name as companyName,COUNT(a.company_name) as id  FROM assets_hardwit c LEFT JOIN `company` a ON a.id = c.company_id GROUP BY  c.company_id  ORDER BY id DESC"})
    List<Company> columnar();

    @Update({"update assets_hardwit set start_provision_date=#{startProvisionDate} where build_num = #{buildNum} and section_id = #{sectionId}"})
    Integer updateStartProvisionDate(@Param("startProvisionDate") String str, @Param("buildNum") String str2, @Param("sectionId") Integer num);

    @Update({"update assets_hardwit set assets_classification_id=#{assetsClassificationId},assets_classification_pid = #{assetsClassificationPid}  where id = #{id} "})
    Integer updateassetsClassification(@Param("id") Integer num, @Param("assetsClassificationId") Integer num2, @Param("assetsClassificationPid") Integer num3);

    @Select({"select count(*) from assets_hardwit where build_num = #{buildNum} and section_id = #{sectionId}"})
    Integer findCountByNumAndId(String str, Integer num);
}